import java.util.HashMap;

public class Soul {
    public int MoreThanHalfNum_Solution (int[] numbers) {
        HashMap<Integer,Integer> map=new HashMap<>();
        int count=numbers.length/2;
        for(int i=0;i<numbers.length;i++){
            if(map.containsKey(numbers[i])){
                int val=map.get(numbers[i]);
                map.put(numbers[i],val+1);
            }else{
                map.put(numbers[i],1);
            }
        }
        int a=0;
        for(int j=0;j<numbers.length;j++){
            if(map.get(numbers[j])>count){
                a=numbers[j];
            }
        }
        return a;
    }
}
